package com.heng.groupchat.common;

/**
 * 错误码
 *
 * @author faye
 */
public enum StatusCode {

    SUCCESS(0, "成功"),
    PARAMS_ERROR(40000, "请求参数错误"),
    PARAMS_NULL_ERROR(40001, "请求参数为空"),
    LOGIN_ERROR(40100, "登录异常"),
    NO_AUTH_ERROR(40101, "无权限"),
    DATA_NULL_ERROR(40400, "数据不存在"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    OPERATION_ERROR(50001, "操作失败"),
    API_REQUEST_ERROR(50010, "接口调用失败"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    SYSTEM_DATABASE_ERROR(50010, "数据库错误");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 状态码信息
     */
    private final String message;

    StatusCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}